package com.vay.de.dang.online.view;

import android.content.Context;

import com.vay.de.dang.online.R;

public class DialogSelectImage extends DialogBottom {

    private OnImageSelector mCallback;

    public DialogSelectImage(Context context) {
        super(context);
        autoWidth(1.0f);
        setContentView(R.layout.dialog_select_image);

        findViewById(R.id.bnt_close).setOnClickListener(view -> {
            dismiss();
        });

        findViewById(R.id.p_camera).setOnClickListener(v -> {
            mCallback.onSelector(1);
            dismiss();
        });

        findViewById(R.id.p_select).setOnClickListener(v -> {
            mCallback.onSelector(2);
            dismiss();
        });
    }

    public void showSelector(OnImageSelector callback) {
        mCallback = callback;
        show();
    }

    public interface OnImageSelector {

        void onSelector(int type);
    }
}
